package com.bone.user.service.impl;

import java.util.List;
import java.util.Map;

import com.bone.page.Page;
import com.bone.user.dao.UserAccountChangeDAO;
import com.bone.user.dao.UserAccountDAO;
import com.bone.user.dao.UserDAO;
import com.bone.user.po.User;
import com.bone.user.po.UserAccount;
import com.bone.user.po.UserAccountChange;
import com.bone.user.service.UserService;
import com.bone.vo.UserVO;

public class UserServiceImpl implements UserService {
	/**
	 * 
	 */
	private UserDAO  userDAO;
    /**
     *  
     */
	private UserAccountDAO userAccountDAO;
	/**
	 *  
	 */
	private UserAccountChangeDAO userAccountChangeDAO;
	
	 
	
	/**
	 *  取UserVO符合查询条件的数据.
	 * @param parameter
	 * @return
	 */
	public Page<UserVO> queryUserVOPageByParam(Map<String, Object> parameter,
			int pageSize, int page) {
		Page pageConfig = Page.page(pageSize, page);
		return this.userDAO.queryUserVOPageByParam(parameter, pageConfig);
	}
	

	/**
	 * 取UserVO符合查询条件的数据.
	 * @param parameter
	 * @return
	 */
	public Long queryUserVOCountByParam(Map<String, Object> para){
		return userDAO.queryUserVOCountByParam(para);
	}
	/**
	 * 
	 * @param para
	 * @return
	 */
	public List<UserVO> queryUserVOListByParam(Map<String, Object> para){
		return userDAO.queryUserVOListByParam(para);
	}
	
	
	/**
	 * 取 UserReceive收货地址   符合查询条件的数据.
	 * @param parameter
	 * @return
	 */
//	public Page<UserReceive> queryUserReceivePageByParam(Map<String, Object> parameter,
//			int pageSize, int page) {
//		Page pageConfig = Page.page(pageSize, page);
//		return this.userDAO.queryUserReceivePageByParam(parameter, pageConfig);
//	}
	
	/**
	 * 根据用户的ID取用户的信息.
	 * @param userId
	 * @return
	 */
	public User queryUserById(Long userId){
		return userDAO.queryUserById(userId);
	}
	
	/**
	 * 用户数据列表.
	 * @param parameter
	 * @return
	 */
	public Page<User> queryUserPageByParam(Map<String, Object> parameter,
			int pageSize, int page) {
		Page pageConfig = Page.page(pageSize, page);
		return this.userDAO.queryUserPageByParam(parameter, pageConfig);
	}
	
	
	/**
	 * 用户账户 数据列表.
	 * @param parameter
	 * @return
	 */
	public Page<UserAccount> queryUserAccountPageByParam(Map<String, Object> parameter,
			int pageSize, int page) {
		Page pageConfig = Page.page(pageSize, page);
		return this.userAccountDAO.queryUserAccountPageByParam(parameter, pageConfig);
	}
	
	
	/**
	 * 用户账户明细数据列表.
	 * @param parameter
	 * @return
	 */
	public Page<UserAccountChange> queryUserAccountChangePageByParam(Map<String, Object> parameter,
			int pageSize, int page) {
		Page pageConfig = Page.page(pageSize, page);
		return this.userAccountChangeDAO.queryUserAccountChangePageByParam(parameter, pageConfig);
	}
	
	

	public UserDAO getUserDAO() {
		return userDAO;
	}

	public void setUserDAO(UserDAO userDAO) {
		this.userDAO = userDAO;
	}

	public UserAccountDAO getUserAccountDAO() {
		return userAccountDAO;
	}

	public void setUserAccountDAO(UserAccountDAO userAccountDAO) {
		this.userAccountDAO = userAccountDAO;
	}

	public UserAccountChangeDAO getUserAccountChangeDAO() {
		return userAccountChangeDAO;
	}

	public void setUserAccountChangeDAO(UserAccountChangeDAO userAccountChangeDAO) {
		this.userAccountChangeDAO = userAccountChangeDAO;
	}
}
